<template>
  <div>
    <div class="title">
      {{ roomInfo.title }}
    </div>
    <div class="desc" v-html="roomInfo.richText"></div>

    <!-- <button
      type="button"
      class="btn btn-block btn-orange btn-exit"
      @click="exit(true)"
    >
      退出登录
    </button> -->
  </div>
</template>
<script>
import { bus } from '@/bus.js';
import { mapState, mapMutations } from 'vuex';
export default {
  name: 'name',
  mixins: [], //混入
  components: {}, //组件
  props: {}, //集成属性
  data() {
    return {};
  },
  computed: {
    ...mapState(['objRoom']),
    roomInfo: function() {
      let _ = this._;
      let obj = this.objRoom;
      return {
        id: _.get(obj, 'roomId', ''),
        title: _.get(obj, 'roomName', ''),
        richText: _.get(obj, 'roomShortInfo', ''),
      };
    },
  },
  methods: {
    ...mapMutations([]),
    test: function() {
      console.log('test');
    },
    exit: function(isActive) {
      window.localStorage.removeItem('userPwd');
      let q = this.$route.query;
      delete q.roomId;
      this.$router.push({
        path: '/enterList',
        query: { ...q },
      });
    },
  },
};
</script>
<style lang="less" scoped>
.title {
  font-size: 1.2em;
  padding: 8px;
}
.desc {
  padding: 8px;
}
</style>
